import { useRoutes, Navigate } from 'react-router-dom'
import CommonUser from '../views/Home/CommonUser'
import TrafficUser from '../views/Home/TrafficUser'
import Home from '../views/Home'
const RouterView = () => {
  const routes = useRoutes([
    {
      path: '/',
      element: <Home></Home>,
      children: [
        { path: 'commonuser', element: <CommonUser></CommonUser> },
        { path: 'trafficuser', element: <TrafficUser></TrafficUser> },
        //重定向到普通用户
        { path: '/', element: <Navigate to={'/commonuser'}></Navigate> },
      ],
    },
  ])
  return routes
}

export default RouterView
